import request from "../axios.js";
import { baseUrl } from "@/config/env";
import axios from "axios";
// import { getStore } from "@/utils/store";

// const token = getStore({ name: "token" });

// 录入人脸
// export function createFace() {
//   return request({
//     url: baseUrl + "/face/createFace",
//     method: "post",
//     // data,
//   });
// }

// 测试人脸
// export function searchFace() {
//   return request({
//     url: baseUrl + "/face/searchFace",
//     method: "post",
//     // data,
//   });
// }

// 线上会议人脸签到
// export function faceSignOnline(data) {
//   return request({
//     url: baseUrl + "/face/faceSignOnline",
//     method: "post",
//     data,
//   });
// }

// 线下会议人脸签到
// export function faceSignOffline() {
//   return request({
//     url: baseUrl + "/face/faceSignOffline",
//     method: "post",
//     // data,
//   });
// }

// ----------------------------------------------------------------- //

// 获取签到配置
export function getSysConfig(params) {
  return request({
    url: baseUrl + "/sysConfig/getSysConfig",
    method: "get",
    params,
  });
}

// 获取人脸信息
export function getFaceSample(params) {
  return request({
    url: baseUrl + "/cmsFace/getFaceInfo",
    method: "get",
    params,
  });
}

// 二进制测试人脸
export function searchFace2() {
  return axios({
    method: "POST",
    url: baseUrl + "/face/searchFace2",
    // data,
    headers: { "Content-Type": "multipart/form-data" },
  });
}

// 录入人脸
export function createFace(data) {
  return request({
    url: baseUrl + "/cmsFace/createFace",
    method: "POST",
    data,
    // headers: { Authorization: token },
  });
}

// 测试人脸
export function searchFace(data) {
  return request({
    url: baseUrl + "/cmsFace/searchFace",
    method: "POST",
    data,
    // headers: { Authorization: token },
  });
}

// 线上人脸签到
export function faceSignOnline(data) {
  return request({
    method: "POST",
    url: baseUrl + "/cmsFace/faceSignOnline",
    data,
  });
}

// 线下会议人脸签到
export function faceSignOffline(data) {
  return request({
    url: baseUrl + "/cmsFace/faceSignOffline",
    method: "POST",
    data,
  });
}

// 更新人脸
export function updateFace(data) {
  return request({
    url: baseUrl + "/cmsFace/updateFace",
    method: "POST",
    data,
  });
}
